Configure the Service Factory
You should write all assemblies inside workspaces. This allows for greater flexibility and provides the ability to create dynamic dashboards. Though several ways exist to create a dynamic dashboard, the following method is recommended. You can complete the setup in three steps, which are defined below.
Step 1: Create a maintenance unit for all assemblies within a workspace.
The first step is organizational, designed to keep all rules within a single location. Create a maintenance unit within the workspace to hold all necessary assemblies. The following image displays multiple maintenance units in each workspace, but only DynamicCode contains assemblies. This will be the central location for all rules.
Step 2: Create an assembly file for the Service Factory.
The second step is to create an assembly file with the source code type of Service Factory.
The Service Factory assembly is needed to take advantage of all items used within assemblies. It should look similar to the following image (the example uses C#):
The code allows you to create the following objects:
-
Dynamic Dashboard
-
XFBRString
-
DataSet
-
Dashboards
-
Components
-
TableViews
-
SqlTableEditor
If you are not using any of the objects listed, keep them commented out in the code. Otherwise, you will get a syntax error when compiling. For example, if you only need the DynamicDashboard call, the Service Factory would look similar to the following image:
Keep the Unknown (line 26) uncommented.
Step 3: Configure the workspace assembly service property.
This last step allows the entire workspace to use the new Service Factory file so your rules run properly. Assembly files will not run correctly if you skip this step.
Go to the workspace and update the Workspace Assembly Service to {WsAssemblyName}.{ServiceFactoryName}. For this example, that would be DynamicCode.WsAssemblyFactory.
You can do this on any given maintenance unit. You should configure the workspace to keep all assembly files within a single maintenance unit. You can designate the workspace and workspace maintenance unit level in all actions.